package Jsuanji;
//计算器用颜色，品牌，价格等属性，有计算加减乘除以及算一个数立方的方法，用oo的思想模拟。
public class Calculator {
    String colour;
    String brand;
    double price;

    public int jia(int j1,int j2){
        System.out.println(j1+j2);
        return j1+j2;
    }
    public double jian(double j1,double j2){
        double a=0;
        if (j1>j2){
            a=j1-j2;
        }else if (j1<j2){
            a=j2-j1;
        }
        System.out.println(a);
       return a;
    }
    public double chen(double c1,double c2){
        System.out.println(c1*c2);
        return c1*c2;
    }
    public double chu(double c1,double c2){
        System.out.println(c1/c2);
        return c1/c2;
    }
    public double lifang( double l1){
        System.out.println(l1*l1*l1);
        return l1*l1*l1;
    }
    public void show(){
        System.out.println("颜色："+colour+" 品牌："+brand+" 价格："+price);
    }

}
